<?php 
if(!defined('ADMIN')){
	exit('Access Denied');
}


?>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?=$page?>" />
	<input type="hidden" name="numPerPage" value="<?=$pagesize?>" />
	<input type="hidden" name="orderField" value="<?=$orderField?>" />
	<input type="hidden" name="orderDirection" value="<?=$orderDirection?>" />
</form>
<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="<?=u(MOD,'list')?>" method="post">
</form>
<div class="pageHeader">
	<p><b>内容模型管理</b></p>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<?=u(MOD,'addedi')?>" target="dialog"><span>新建内容模型</span></a></li>
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids[]" href="<?=u(MOD,'del')?>" class="delete"><span>批量删除</span></a></li>
			<li><a class="edit" href="<?=u(MOD,'addedi',array('id'=>'{id}'))?>" target="dialog" warn="请选择一条记录"><span>修改</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
     <table class="table" width="100%" layoutH="138">
     <thead>
                    <tr>
                      <th width="3%"><input type="checkbox" group="ids[]" class="checkboxCtrl" /></th>
					  <th width="20%">模型名称</th>
                      <th width="10%">数据表名</th>
                      <th width="">描述</th>
                      <th width="10%">内容数量</th>
                      
                      <th width="20%">操作</th>
                    </tr>
	</thead>
    <tbody>                    
					<?php foreach ($row as $r){?>
					  <tr target="id" rel="<?=$r["id"]?>">
                        <td class="center"><input <?php if($r['sys']==1){?>title="系统数据，不准删除"  disabled="disabled"<?php }?> type='checkbox' name='ids[]' value='<?=$r["id"]?>' /></td>
                        <td class="center"><?=$r["title"]?></td>
                        <td class="center"><?=$r["tablename"]?></td>
                        <td><?=$r["content"]?></td>
                        <td class="center"><?=$r["num"]?></td>
                        

                        
						<td class="center">
                        
                        <a title="字段管理"  href="<?=u(MOD,'modelfield',array('id'=>$r['id']))?>" target="navTab" rel="page<?=$r["id"]?>" class="btnAdd">字段管理</a>
                        <a title="编辑"  href="<?=u(MOD,'addedi',array('id'=>$r['id']))?>" target="dialog" class="btnEdit">编辑</a>
                        <?php if($r['sys']!=1){?>
                        <a title="注意：删除模型，将清除模型下的所有栏目、文章及相关数据！" target="ajaxTodo" href="<?=u(MOD,'del',array('id'=>$r['id']))?>" class="btnDel">删除</a>
                        <?}?>
                        </td>
					  </tr>
					<?php }?>
                    </tbody>
                  </table>

</div>  
